<template>
	<view>
		<view class="box">
			<view class="content">
				<view class="tit">账户余额</view>
				<view class="num">￥<text>5000</text></view>
				<button @click="navTo('/pages/pay/recharge')" hover-class="common-hover">充值</button>
			</view>
			<view class="time">
				<view class="time-top">
					<view class="time-con">
						{{date}}
					</view>
					<view class="days-con">
						
						<picker mode="date" @change="bindDateChange" fields="month">
						选择日期<image src="../../static/user/sjRight.png" mode="widthFix"></image>
						</picker>
					</view>
				</view>
				<view class="time-list">
					
					<view style="margin-bottom: 30rpx;">
						<view class="list-con">
							<text>充值</text>
							<text>+290.00</text>
						</view>
						<view>2017-08-08</view>
					</view>
					<view>
						<view class="list-con">
							<text>充值</text>
							<text>+290.00</text>
						</view>
						<view>2017-08-08</view>
					</view>
					
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				date: ''
			}
		},
		
		onShow() {
			this.date = this.dateTime()
		},
		
		methods: {
			bindDateChange: function(e) {
				let val = e.detail.value.split('-')
				this.date = val[0] + '年' + val[1] + '月'
			},
			
			dateTime(e) {
				var d = new Date();
				var y = d.getFullYear();
				var m = d.getMonth() + 1;
				return y + '年' + m + '月';
			},
			navTo(url) {
				uni.navigateTo({
					url: url
				})
			}
		},
		
	}
</script>

<style lang='scss'>
	.box{
		padding: 20rpx 30rpx;
		.days-con{
			image{
				width: 10rpx;
				height: auto;
				margin-left: 8rpx;
			}
		}
		.content{
			width: 100%;
			background-color: #4b9df9;
			border-radius: 10rpx;
			box-shadow: 0 0 20rpx 2rpx #4b9df9;
			color: #fff;
			padding: 30rpx;
			box-sizing: border-box;
			view{
				margin-bottom: 32rpx;
			}
			.tit{
				border-left: 4rpx solid #fff;
				padding-left: 15rpx;
				line-height: 30rpx;
			}
			.num{
				font-weight: bold;
				font-size: 50rpx;
				text{
					font-size: 94rpx;
				}
			}
			
			button{
				background-color: #70b1fa;
				font-weight: bold;
				color: #fff;
			}
		}
		.time{
			margin-top: 60rpx;
			.time-top{
				color: #444;
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-bottom: 22rpx;
				.time-con{
					font-size: 30rpx;
				}
				.days-con{
					font-size: 26rpx;
					color: #666;
				}
			}
			.time-list{
				view{
					font-size: 24rpx;
					color: #999;
				}
				.list-con{
					font-size: 20rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
					color: #333;
					margin-bottom: 5rpx;
					text{
						display: block;
						font-size: 32rpx;
					}
				}
			}
		}
	}
</style>
